import axios from 'axios'

const baseURL = import.meta.env.VITE_API_BASE_URL
import {
    ElLoading
} from 'element-plus'

//export将service传出去
export const service = axios.create({
    baseURL: baseURL,
    timeout: 30000,//超时设置
    withCredentials: true, //异步请求携带cookie
    headers: {
        //设置后端需要的传参类型
        'Content-Type': 'application/json;charset=UTF-8;',
        //'token': 'your token',
        'X-Requested-With': 'XMLHttpRequest'
    }
})